<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js"></script>
</head>
<body>
    <div id="app">
        <model1></model1>
    </div>
    <div id="app1">
        <model1></model1>
    </div>

    <script type="text/javascript">
        Vue.component("model1",{
            template:"<div><h1>{{title}}</h1><button type='button' @click='ddfn'>点我</button></div>",
            data:function () {
                return {
                    title:"hello Vue组件"
                }
            },
            methods:{
                ddfn:function () {
                    alert("没吃饭啊，点不动 !!!");
                    // this.title="没吃饭啊，点不动！！！"
                }
            }
        });

        new Vue({
            el:'#app'
        });

        new Vue({
            el:'#app1'
        });

    </script>

</body>

</html>